Skip to content

if cp2k output is not converged, return the sys len = 0#184

Merged
amcadmus merged 5 commits into
deepmodeling:develfrom
robinzyb:devel
Aug 9, 2021
Merged

if cp2k output is not converged, return the sys len = 0#184
amcadmus merged 5 commits into
deepmodeling:develfrom
robinzyb:devel

Conversation

@robinzyb

@robinzyb robinzyb commented Aug 3, 2021

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread dpdata/cp2k/output.py
1. use fp.seek(0) to avoid open file twice
2. add 'scf run' line in cp2k_output to read the output content, just to
   test the parser.
@codecov-commenter

codecov-commenter commented Aug 4, 2021

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.24%. Comparing base (95a48ea) to head (d4323c5).
Report is 461 commits behind head on devel.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel     #184      +/-   ##
==========================================
- Coverage   84.22%   81.24%   -2.98%     
==========================================
  Files          28       54      +26     
  Lines        3296     4554    +1258     
==========================================
+ Hits         2776     3700     +924     
- Misses        520      854     +334     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@robinzyb robinzyb requested a review from njzjz August 4, 2021 06:56
Comment thread tests/cp2k/cp2k_output

@njzjz njzjz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test for non-coverage system like this one

class TestNonCoveragedGaussianLoadLog(unittest.TestCase, TestGaussianLog):
def setUp (self) :
self.system = dpdata.LabeledSystem('gaussian/noncoveraged.gaussianlog',
fmt = 'gaussian/log')
self.atom_names = []
self.atom_numbs = []
self.nframes = 0
def test_atom_types(self) :
self.assertEqual(self.system.data['atom_types'], [])
def test_cells(self) :
self.assertEqual(self.system.data['cells'], [])
def test_coords(self) :
self.assertEqual(self.system.data['coords'], [])
def test_energies(self) :
self.assertEqual(self.system.data['energies'], [])
def test_forces(self) :
self.assertEqual(self.system.data['forces'], [])
def test_virials(self) :
self.assertFalse('virials' in self.system.data)

@robinzyb robinzyb requested a review from njzjz August 9, 2021 02:33
@amcadmus amcadmus merged commit 674a95f into deepmodeling:devel Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants